angular.module('book_fantasyApp', [])
    .controller('book_fantasyCtrl', ['$scope', '$http', '$location', function ($scope, $http, $location) {
        $scope.title = 'test title';
        $scope.fantasyData = [];
        
        $scope.search = $location.search();        

        $http.get('./src/data/fantasyData.json').then(function (value) {
            $scope.fantasyData = value.data;
        });

        $scope.linkFn = function (id) {
            console.log(id);
            $location.path('/home').search({
                id: id
            });
        }
    }]);